﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace 商场收银系统v2._2工厂And策略模式
{
    public class CashReturn : CashSuper
    {
        private double _moneyCondition = 0.0d;
        private double _moneyReturn = 0.0d;

        public CashReturn(double moneyCondition, double moneyReturn)
        {
            _moneyCondition = moneyCondition;
            _moneyReturn = moneyReturn;
        }

        public override double Payment(double money)
        {
            if (money >= _moneyCondition)
            {
                money -= _moneyReturn;
                return money;
            }
            else
                return money;
        }
    }
}
